package com.baicaoyuan.web.service;

import com.baicaoyuan.web.common.TimeUtils;
import com.baicaoyuan.web.enums.LevelEnum;
import com.baicaoyuan.web.model.ProjectItemUserDO;
import com.baicaoyuan.web.model.ScoreDetailDO;
import com.baicaoyuan.web.model.StockDetailsDO;
import com.baicaoyuan.web.repository.ScoreDetailRepository;
import com.baicaoyuan.web.repository.StockDetailsRepository;
import com.baicaoyuan.web.response.ScoreDetailResponse;
import com.baicaoyuan.web.response.StockDetailResponse;
import org.springframework.beans.BeanUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.math.BigDecimal;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;

/**
 * 功能描述：
 *
 * @author 罗富祥
 * 创建时间： 2018/1/4
 */
@Service
public class StockDetailService {

    @Autowired
    private StockDetailsRepository stockDetailsRepository;



    public List<StockDetailResponse> getStockDetails(Long userId) {
        List<StockDetailResponse> result = new ArrayList<>();
        List<StockDetailsDO> list = this.stockDetailsRepository.getStockDetails(userId);
        list.stream().forEach(x -> {
            StockDetailResponse res = new StockDetailResponse();
            BeanUtils.copyProperties(x, res);
            result.add(res);
        });

        return result;
    }
}

